package com.beta.em.home;

/**
 * Created by vector on 2016/11/17.
 */
public enum HomeRecommendType {

    HXTY("hxty", "自营"),
    NEWS("news", "新品"),
    PROMOTIONS("promotions", "促销");

    public final String value;

    public final String cnValue;

    HomeRecommendType(String value, String cnValue) {
        this.value = value;
        this.cnValue = cnValue;
    }

    public static String getCnValue(String value) {
        for (HomeRecommendType status: values()) {
            if (status.value.equals(value)) {
                return status.cnValue;
            }
        }
        return null;
    }

    public static HomeRecommendType getRecommendType(String value) {
        for (HomeRecommendType bannerType: values()) {
            if (bannerType.value.equals(value)) {
                return bannerType;
            }
        }
        return null;
    }

}
